package com.gaojiawei.multiThread18_CompletableFutureTask;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class L02_RunAsync {

    private static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10);

    public static void main(String[] args) {
        testRunAsync();
    }

    /**
     * 既不会接受参数也不会返回结果，非常基础的任务编排方式
     */
    public static void testRunAsync(){

        CompletableFuture.runAsync(()->{
            System.out.println("begin a");
            System.out.println("finish a");
        },fixedThreadPool);
    }
}
